; ModuleID = 'test/redundant_check.bc'
target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
target triple = "i386-pc-linux-gnu"

@C.0.1544 = private constant [4 x i32] [i32 1, i32 2, i32 3, i32 4]
@.str = private constant [3 x i8] c"d\0A\00", align 1
@.str1 = private constant [4 x i8] c"%d\0A\00", align 1

define i32 @main() nounwind {
entry:
  %retval = alloca i32
  %0 = alloca i32
  %a = alloca [4 x i32]
  %i = alloca i32
  %sum = alloca i32
  %"alloca point" = bitcast i32 0 to i32
  %1 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 0
  %2 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1544, i32 0, i32 0), align 4
  store i32 %2, i32* %1, align 4
  %3 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 1
  %4 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1544, i32 0, i32 1), align 4
  store i32 %4, i32* %3, align 4
  %5 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 2
  %6 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1544, i32 0, i32 2), align 4
  store i32 %6, i32* %5, align 4
  %7 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 3
  %8 = load i32* getelementptr inbounds ([4 x i32]* @C.0.1544, i32 0, i32 3), align 4
  store i32 %8, i32* %7, align 4
  store i32 8, i32* %i, align 4
  store i32 0, i32* %sum, align 4
  br label %bb1

bb:                                               ; preds = %bb1
  %9 = load i32* %i, align 4
  %10 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 %9
  %11 = load i32* %10, align 4
  %12 = load i32* %sum, align 4
  %13 = add nsw i32 %11, %12
  store i32 %13, i32* %sum, align 4
  %14 = load i32* %sum, align 4
  %15 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([3 x i8]* @.str, i32 0, i32 0), i32 %14) nounwind
  %16 = load i32* %i, align 4
  %17 = add nsw i32 %16, 1
  store i32 %17, i32* %i, align 4
  br label %bb1

bb1:                                              ; preds = %bb, %entry
  %18 = load i32* %i, align 4
  %19 = icmp sle i32 %18, 3
  br i1 %19, label %bb, label %bb2

bb2:                                              ; preds = %bb1
  %20 = load i32* %i, align 4
  %21 = getelementptr inbounds [4 x i32]* %a, i32 0, i32 %20
  %22 = load i32* %21, align 4
  %23 = load i32* %sum, align 4
  %24 = add nsw i32 %22, %23
  store i32 %24, i32* %sum, align 4
  %25 = load i32* %sum, align 4
  %26 = call i32 (i8*, ...)* @printf(i8* noalias getelementptr inbounds ([4 x i8]* @.str1, i32 0, i32 0), i32 %25) nounwind
  store i32 0, i32* %0, align 4
  %27 = load i32* %0, align 4
  store i32 %27, i32* %retval, align 4
  br label %return

return:                                           ; preds = %bb2
  %retval3 = load i32* %retval
  ret i32 %retval3
}

declare i32 @printf(i8* noalias, ...) nounwind
